<template>
  <div id="specCollection">
    <!-- <Breadcrumb content="标本接收" /> -->
    <div class="bodyContent">
      <el-tabs v-model="activeName" type="border-card" @change="tabSelectChange">
        <el-tab-pane label="标本接收" name="speccollection">
          <vxe-toolbar perfect>
            <template #buttons>
              <span class="margin-lr-xs text-Bold text-shadow">条码号:</span>
              <vxe-input ref="specCodeInput" v-model="form.specCode" clearable @compositionstart.native="compositionstart" @compositionend.native="compositionend" @keyup="specInputKeyUp"></vxe-input>
              <vxe-button type="text" content="接收" class="button-blue" :disabled="newSpecSignDetailList.length === 0" @click="handleSign"></vxe-button>
              <vxe-button type="text" content="清屏" class="button-blue" @click="ClearScreen"></vxe-button>
              <vxe-button icon="vxe-icon-undo" type="text" class-name="text-black text-bold" content="标本退回" class="button-red" @click="returnSpec"></vxe-button>
            </template>
            <template #tools>
              <span class="text-bold text-df margin-lr-xs vxe-icon-square-fill solid-bottom">标本接收</span>
            </template>
          </vxe-toolbar>
          <div class="padding-xs" style="background-color: #f8f8f9">
            <div style="border: 1px dashed green; width: 100%" class="radius line-olive flex justify-start bg-gray">
              <div style="width: 70px; padding: 2.5px" class="flex justify-center text-center">
                <div style="width: 65px; height: 100%" class="radius solid bg-yellow"></div>
              </div>
              <div style="height: 100%" class="bg-gray">
                <vxe-form :data="currentSpecSignDetail" class-name="padding-xs width-100-percentage" style="background-color: rgba(0, 0, 0, 0)" title-width="70px">
                  <vxe-form-gather span="6">
                    <vxe-form-item title="条码号" field="reqNo" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">条码号</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input v-model="data.reqNo" readonly placeholder="条码号" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                  <vxe-form-gather span="6">
                    <vxe-form-item title="申请号" field="hisReqId" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">申请号</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input v-model="data.hisReqId" readonly placeholder="申请号" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                  <vxe-form-gather span="6">
                    <vxe-form-item title="病人ID号" field="patId" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">病人ID号</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input v-model="data.patId" readonly placeholder="病人ID号" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                  <vxe-form-gather span="6">
                    <vxe-form-item title="姓名" field="patNa" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">姓名</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input v-model="data.patNa" readonly placeholder="姓名" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                  <vxe-form-gather span="6">
                    <vxe-form-item title="性别" field="sex" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">性别</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input v-model="data.sex" readonly placeholder="性别" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                  <!-- <vxe-form-gather span="6">
                  <vxe-form-item title="容器" field="specContainer" class-name="width-100-percentage">
                    <template #title>
                      <span class="text-bold padding-left-xs">容器</span>
                    </template>
                    <template #default="{ data }">
                      <vxe-input :value="data.specContainer ? data.specContainer.name : ''" readonly placeholder="采样部位" class-name="width-100-percentage" />
                    </template>
                  </vxe-form-item>
                </vxe-form-gather>
                <vxe-form-gather span="6">
                  <vxe-form-item title="采样部位" field="samplingSite" class-name="width-100-percentage">
                    <template #title>
                      <span class="text-bold padding-left-xs">采样部位</span>
                    </template>
                    <template #default="{ data }">
                      <vxe-input :value="data.samplingSite ? data.samplingSite.name : ''" readonly placeholder="采样部位" class-name="width-100-percentage" />
                    </template>
                  </vxe-form-item>
                </vxe-form-gather>
                <vxe-form-gather span="6">
                  <vxe-form-item title="采样方法" field="samplingMethod" class-name="width-100-percentage">
                    <template #title>
                      <span class="text-bold padding-left-xs">采样方法</span>
                    </template>
                    <template #default="{ data }">
                      <vxe-input :value="data.samplingMethod ? data.samplingMethod.name : ''" readonly placeholder="采样方法" class-name="width-100-percentage" />
                    </template>
                  </vxe-form-item>
                </vxe-form-gather>
                <vxe-form-gather span="6">
                  <vxe-form-item title="样本量" field="specAmount" class-name="width-100-percentage">
                    <template #title>
                      <span class="text-bold padding-left-xs">样本量</span>
                    </template>
                    <template #default="{ data }">
                      <vxe-input v-model="data.specAmount" readonly placeholder="样本量" type="number" class-name="width-100-percentage" />
                    </template>
                  </vxe-form-item>
                </vxe-form-gather> -->
                  <vxe-form-gather span="6">
                    <vxe-form-item title="签收状态" field="isSign" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">签收状态</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input :value="data.isSign ? '已签收' : '未签收'" readonly placeholder="签收状态" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                  <vxe-form-gather span="12">
                    <vxe-form-item title="项目" field="feeName" class-name="width-100-percentage">
                      <template #title>
                        <span class="text-bold padding-left-xs">项目</span>
                      </template>
                      <template #default="{ data }">
                        <vxe-input v-model="data.feeName" readonly placeholder="项目" class-name="width-100-percentage" />
                      </template>
                    </vxe-form-item>
                  </vxe-form-gather>
                </vxe-form>
              </div>
            </div>
          </div>
          <div class="specSignDetailTable" :style="{
              height: isChildren ? 'calc(100% - 40px - 40px)' : 'calc(100% - 40px - 82px - 5px)'
            }">
            <vxe-table ref="specSignDetailTable" v-loading="loading" border class="mytable-scrollbar" height="auto" :menu-config="tableMenuTop" @menu-click="contextMenuClickEventTop" :data="specSignDetailList" :row-config="{ isCurrent: true, isHover: true }" :keyboard-config="{ isArrow: true, isTab: true, isEdit: true }" @current-change="specSignDetailRowClick" resizable show-overflow>
              <!-- <vxe-column type="checkbox" width="26"></vxe-column> -->
              <vxe-column field="seq" title="序号" width="30"></vxe-column>
              <vxe-column field="isSuccess" title="状态" width="60" align="center">
                <template #default="{ row, rowIndex }">
                  <span v-if="row.loading" class="text-blue">接收中...</span>
                  <span v-else-if="row.isSuccess" class="text-18 text-green el-icon-success">
                    <el-icon color="#409EFC" class="no-inherit">
                      <CircleCheck />
                    </el-icon>
                  </span>
                  <span v-else class="text-blue" @click="againSign(row, rowIndex)">重新接收</span>
                </template>
              </vxe-column>
              <vxe-column field="reqNo" title="条码号" width="100px">
                <template #default="{ row }">
                  <span>{{ row.reqNo ? row.reqNo : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="hisReqId" title="申请号" width="80px">
                <template #default="{ row }">
                  <span>{{ row.hisReqId ? row.hisReqId : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="isSign" title="签收状态" width="80px" align="center">
                <template #default="{ row }">
                  <span :class="row.isSign ? 'text-blue' : 'text-red'">
                    {{ row.isSign === 1 ? '已签收' : '未签收' }}
                  </span>
                </template>
              </vxe-column>
              <!-- <vxe-column field="isOriginal" title="是否原始标本" width="100px" align="center">
              <template #default="{ row }">
                <span v-if="row.spec" :class="row.spec.isOriginal ? 'text-blue' : 'text-red'">
                  {{ row.spec.isOriginal ? '是' : '否' }}
                </span>
              </template>
            </vxe-column> -->
              <!-- <vxe-column field="name" title="传送方式" width="100px"></vxe-column> -->
              <vxe-column field="patId" title="病人ID" width="100">
                <template #default="{ row }">
                  <span>{{ row.patId ? row.patId : '' }}</span>
                  <span></span>
                </template>
              </vxe-column>
              <vxe-column field="patNa" title="姓名" width="100">
                <template #default="{ row }">
                  <span>{{ row.patNa ? row.patNa : '' }}</span>
                  <span></span>
                </template>
              </vxe-column>
              <vxe-column field="sex" title="性别" width="100">
                <template #default="{ row }">
                  <span> {{ row.sex === '1' ? '男' : row.sex === '2' ? '女' : '未知' }}</span>
                  <span></span>
                </template>
              </vxe-column>
              <vxe-column field="medicalRecAge" title="年龄" width="100">
                <template #default="{ row }">
                  <span>{{ row.age ? row.age : '' }}</span>
                  <span></span>
                </template>
              </vxe-column>
              <vxe-column field="sampleTypeNa" title="样本类型" width="100">
                <template #default="{ row }">
                  <span>{{ row.sampleTypeNa ? row.sampleTypeNa : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="feeName" title="项目" width="180">
                <template #default="{ row }">
                  <span>{{ row.feeName ? row.feeName : '' }}</span>
                  <span></span>
                </template>
              </vxe-column>
              <vxe-column field="reqDoctorNa" title="申请人" width="80">
                <template #default="{ row }">
                  <span>{{ row.reqDoctorNa ? row.reqDoctorNa : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="reqTime" title="申请时间" width="120">
                <template #default="{ row }">
                  <span>{{ row.reqTime ? row.reqTime : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="samplingDoctorNa" title="采集人" width="80">
                <template #default="{ row }">
                  <span>{{ row.samplingDoctorNa ? row.samplingDoctorNa : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="samplingTime" title="采集时间" min-width="120">
                <template #default="{ row }">
                  <span>{{ row.samplingTime ? row.samplingTime : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="signer" title="接收人" width="80">
                <template #default="{ row }">
                  <span>{{ row.signerNa ? row.signerNa : '' }}</span>
                </template>
              </vxe-column>
              <vxe-column field="signTime" title="接收时间" width="120">
                <template #default="{ row }">
                  <span>{{ row.signTime ? row.signTime : '' }}</span>
                </template>
              </vxe-column>
            </vxe-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="标本接收历史" name="speccollectionhistory">
          <SpecCollectionHistory />
        </el-tab-pane>
      </el-tabs>
      <vxe-modal v-model="returnReasonModule" width="600" show-footer destroy-on-close>
        <template #title>
          <span style="color: red">标本退回理由</span>
        </template>
        <template #default>
          <div>
            <!-- <vxe-textarea
              v-model="returnReason"
              placeholder="请输入回退理由"
              :style="{ height: 'calc(40vh - 20px) !important' }"
              resize="vertical"
              className="vxe-textarea-height"
            ></vxe-textarea> -->
            <UnqualifiedSpecRec />
          </div>
        </template>
        <template #footer>
          <div class="flex justify-end padding-right-xs">
            <vxe-button class-name="margin-left-sm" content="取消" @click="returnReasonModule = false"></vxe-button>
            <vxe-button class-name="margin-left-sm" status="primary" content="确定" @click="confirmReturnSpec"></vxe-button>
          </div>
        </template>
      </vxe-modal>
    </div>
  </div>
</template>
<script lang="ts" setup>
// 引入组件区 ==========
import Breadcrumb from '@/components/Breadcrumb.vue'; //面包屑
import { onMounted, ref, reactive, getCurrentInstance } from 'vue';
import { VXETable } from 'vxe-table';
import { AppStore } from '../../../stores/store';
import { IsEmpty, formatDateTime } from '@/utils/common';
import SpecCollectionHistory from './labSpecCollectionHistory.vue';
import XEClipboard from 'xe-clipboard';
import { VxeMessage, VxeNotifyType } from '../../../utils/CommonMessage';
import UnqualifiedSpecRec from '@/components/UnqualifiedSpecRec.vue';

// 全局变量定义区 ==========
let { proxy }: any = getCurrentInstance();
let props = defineProps({}) as any;

let tableMenuTop = {
  className: 'my-menus',
  body: {
    options: [
      [
        {
          code: 'copy',
          name: '复制内容',
          prefixIcon: 'vxe-icon-copy',
          className: 'my-copy-item',
          isVisible: false
        }
      ]
    ]
  },
  visibleMethod: ({ options, column }) => {
    const isVisible = column && column.field === 'specCode';
    options.forEach((list) => {
      list.forEach((item) => {
        if (column) {
          if (item.code === 'copy') {
            item.visible = isVisible;
          }
        } else {
          item.visible = false;
        }
      });
    });
    return true;
  }
};
let errData = {};
let store = AppStore();
let userInfo = store.userInfo;
let activeName = 'speccollection';
let showHistory = false;
let pageIndex = 1;
let totalCount = 0;
let loading = ref(false);
let lock = false;
let specSignDetailList = reactive([]); //列表
let newSpecSignDetailList = reactive([]); //未签收标本数组
let currentSpec = {} as any; //当前标本
let currentSpecSign = {} as any; //当前接收记录
let currentSpecSignDetail = reactive({
  reqNo: '',
  hisReqId: '',
  patId: '',
  patNa: '',
  sex: '',
  isSign: '',
  feeName: '',
  id: null
}); //当前采集记录详情
let currentRowIndex = 0;
let form = reactive({
  specCode: '',
  realSpecCode: '',
  searchValue: ''
});
let code = ref('');
// 方法定义区 =============
onMounted(() => {
  (proxy.$refs.specCodeInput as any).focus();
  code.value = proxy.$route.query.code;
});

// 清空 currentSpecsamplingDetail 对象的所有属性
function clearCurrentSpecsamplingDetail() {
  Object.keys(currentSpecSignDetail).forEach((key) => {
    currentSpecSignDetail[key] = '';
  });
}
// 条码号输入框清空，并获取焦点
function clearSpecCodeInput() {
  form.specCode = '';
  (proxy.$refs.specCodeInput as any).focus();
}
// 条码号输入框失去焦点
function specCodeInputBlur() {
  (proxy.$refs.specCodeInput as any).blur();
}
// 条码号输入框中文输入法开始输入
function compositionstart() {
  lock = true;
  form.realSpecCode = form.specCode;
}
// 条码号输入框中文输入法结束输入
function compositionend() {
  lock = false;
  form.specCode = form.realSpecCode;
}
// 键盘输入为中文状态，转为英文字符
function specInputKeyUp(e) {
  if (e.$event.code === 'Enter' || e.$event.code === 'NumpadEnter') {
    getspecByCode(form.specCode);
  }
  if (!lock) {
    return;
  }
  if (e.key === 'Backspace' && form.realSpecCode) {
    form.realSpecCode = form.realSpecCode.slice(0, -1);
  }
  const reg = /^[\w!@#$%^&*\(\)-+=|':./<>?`~]{1}$/;
  if (reg.test(e.key)) {
    form.realSpecCode += e.key;
  }
  // form.specCode = form.realSpecCode;
}

// 查询出标本数据后，进行接收操作
function specCodeInputEnter(specId, reqNo, index) {
  const url = '/lab/reqMain/createCollectionDetail';
  const data = {
    reqNo: reqNo,
    id: specId,
    actStateCode: code.value
  };
  proxy.$http
    .post(url, data)
    .then((res: any) => {
      if (res.status.code === 1) {
        res.data[0].isSuccess = true;
        res.data[0].loading = false;
        Object.assign(currentSpecSignDetail, res.data[0]);
        Object.assign(specSignDetailList[index], res.data[0]);
      } else {
        currentSpec = {};
        clearCurrentSpecsamplingDetail();
        specSignDetailList.splice(index, 1);
        VxeMessage(res.status.msg, VxeNotifyType.error);
      }
    })
    .catch((err: any) => {
      specCodeInputBlur();
      currentSpec = {};
      clearCurrentSpecsamplingDetail();
      specSignDetailList.splice(index, 1);
      proxy.$alert(err.data.error.message, '提示', {
        callback: (action) => {
          const time = setTimeout(() => {
            clearSpecCodeInput();
            clearTimeout(time);
          }, 200);
        }
      });
    });
  clearSpecCodeInput();
}

//新增性状
function handleAdd(specCode) {
  const newRow = {
    id: null,
    reqNo: null,
    specCode,
    loading: true, //是否正在创建
    isSuccess: false //是否创建成功
  };

  specSignDetailList.push(newRow);
  newSpecSignDetailList.push(newRow);
  const $table = proxy.$refs.specSignDetailTable as any;
  $table.reloadData(specSignDetailList);
  $table.setEditRow(newRow);
  $table.setCurrentRow(newRow);
  return specSignDetailList.length - 1;
}
// 行点击事件
function specSignDetailRowClick({ row, rowIndex }) {
  clearCurrentSpecsamplingDetail();
  currentRowIndex = rowIndex;
  Object.assign(currentSpecSignDetail, row);
}
// #region
// 获取标本信息
async function getspecByCode(specCode) {
  if (IsEmpty(specCode) || IsEmpty(specCode.trim())) {
    VxeMessage('条码号不可为空', VxeNotifyType.error);
    return;
  }
  const index = handleAdd(specCode);
  try {
    const url = '/lab/reqMain/getReqMainByReqNo';
    proxy.$http
      .get(url, { params: { reqNo: specCode } })
      .then(async (res: any) => {
        if (res.status.code === 200 && res.data.length > 0) {
          currentSpec = res.data;
          specSignDetailList[index].id = res.data[0].id;
          specSignDetailList[index].reqNo = res.data[0].reqNo;
          Object.assign(specSignDetailList[index], res.data[0]);
          if (res.data[0].isSign === '1') {
            //已经签收的做提示
            specCodeInputBlur();
            let content = '当前标本';
            content += res.isSigned
              ? `已于${res.data[0].signTime}${res.data[0].signerNa ? '被' + res.data[0].signerNa + '操作' : ''
              }接收`
              : '';
            content += ',请先退回才能再次接收？';
            const type = await VXETable.modal.confirm(content);
            clearCurrentSpecsamplingDetail();
            currentSpec = {};
            specSignDetailList.splice(index, 1);
            const time = setTimeout(() => {
              clearSpecCodeInput();
              clearTimeout(time);
            }, 200);
          } else {
            specCodeInputEnter(res.data[0].id, res.data[0].reqNo, index);
          }
        }
      })
      .catch((err: any) => {
        proxy.$alert(err, '提示');
      });
  } catch (err) {
    // clearSpecCodeInput();
    specCodeInputBlur();
    proxy.$alert(err.data.error.message, '提示', {
      callback: (action) => {
        const time = setTimeout(() => {
          clearSpecCodeInput();
          clearTimeout(time);
        }, 200);
      }
    });
  }
}
// 清屏
function ClearScreen() {
  specSignDetailList.length = 0;
  return;
}
//页签选择改变
function tabSelectChange(e) {
  // console.log('页签', e);
}
//创建标本接收
function saveSpecSign(index) {
  const url = '/api/lims/spec-signs';
  const data = {
    // tenantId: EmptyUUID(),
    organizationUnitId: userInfo.employee ? userInfo.employee.organizationUnitId : null,
    specSignNo: '',
    signerId: userInfo.employeeId,
    signTime: formatDateTime(new Date(), 'yyyy-MM-dd hh:mm:ss'),
    specialConsiderations: ''
  };
  return new Promise((resolve, reject) => {
    axios
      .post(url, data)
      .then((res: any) => {
        currentSpecSign = res;
        resolve({ state: true, data: res });
      })
      .catch((err) => {
        errData = err;
        reject({ state: false });
        // 报错后显示重新接收
        specSignDetailList[index].isAgain = true;
        (proxy.$refs.specSignDetailTable as any).reloadData(specSignDetailList);
        proxy.$alert(err.data.error.message, '提示');
      });
  });
}
//创建标本接收详情
function saveSpecSignDetail(specId, specSign, index) {
  const url = '/api/lims/spec-sign-details';
  const data = {
    specSignId: specSign.id,
    specId,
    specialConsiderations: ''
  };
  axios
    .post(url, data)
    .then((res: any) => {
      res.isSuccess = true;
      res.loading = false;
      currentSpecSignDetail = res;
      if (!IsEmpty(index)) {
        specSignDetailList[index] = Object.assign({}, res);
      }

      (proxy.$refs.specSignDetailTable as any).reloadData(specSignDetailList);
    })
    .catch((err) => {
      // 报错后显示重新接收
      specSignDetailList[index].isAgain = true;
      (proxy.$refs.specSignDetailTable as any).reloadData(specSignDetailList);
      $alert(err.data.error.message, '提示');
    });
}
// 批量接收
async function handleSign() {
  if (newSpecSignDetailList.length === 0) {
    (this as any).$XModal.message({ content: '没有可以接收的标本', status: 'error' });
    return;
  }
  for (let i = 0; i < newSpecSignDetailList.length; i++) {
    const item = newSpecSignDetailList[i];
    newSpecSignDetailList[i].isAgain = false;
    newSpecSignDetailList[i].loading = true;
    const specSign: any = await saveSpecSign(item.index);
    if (specSign.state) {
      saveSpecSignDetail(item.specId, specSign.data, item.index);
    }
    if (i === newSpecSignDetailList.length - 1) {
      newSpecSignDetailList = [];
    }
  }
}
// 重新接收
function againSign(row, rowIndex) {
  if (row.specId) {
    specCodeInputEnter(row.id, row.reqNo, rowIndex);
  } else {
    getspecByCode(row.reqNo);
  }
}

//右键菜单
function contextMenuClickEventTop({ menu, row, column }) {
  switch (menu.code) {
    case 'copy':
      if (row && column) {
        const a = 'spec';
        if (XEClipboard.copy(row[a][column.property])) {
          VXETable.modal.message({ content: '已复制到剪贴板！', status: 'success' });
        }
      }
      break;
    default:
      VXETable.modal.message(`点击了 ${menu.name} 选项`);
  }
}
let returnReasonModule = false;
let returnReason = '';
//  标本退回
function returnSpec() {
  if (IsEmpty(currentSpecSignDetail.reqNo) || IsEmpty(currentSpecSignDetail.id)) {
    //(this as any).$XModal.message({ content: '请先选择回退标本', status: 'warning' });
    VxeMessage('请先选择回退标本', VxeNotifyType.error);
    return;
  } else {
    const index = (proxy.$refs.specSignDetailTable as any).getRowIndex(currentSpecSignDetail);
    specSignDetailList.splice(index, 1);
  }
  returnReasonModule = true;
}
function confirmReturnSpec() {
  if (IsEmpty(returnReason)) {
    (this as any).$XModal.message({ content: '请回退理由', status: 'warning' });
    return;
  }
  loading = true;
  //当前登录用户 EmpId
  const loginUser = JSON.parse(localStorage.getItem('userInfo'));
  const url = '/api/lims/spec-signs/spec-return';
  const data = {
    specId: currentSpecSignDetail.specId,
    specSignId: currentSpecSignDetail.specSignId,
    isReturn: true,
    returnerId: loginUser && !IsEmpty(loginUser.employeeId) ? loginUser.employeeId : '',
    returnDate: formatDateTime(new Date(), 'yyyy-MM-dd hh:mm:ss'),
    returnReason: returnReason
  };

  axios
    .post(url, data)
    .then((res: any) => {
      if (res) {
        (this as any).$XModal.message({ content: '回退成功', status: 'success' });
        returnReasonModule = false;
        const index = (proxy.$refs.specSignDetailTable as any).getRowIndex(currentSpec);
        specSignDetailList.splice(index, 1);
      }
      loading = false;
    })
    .catch((err) => {
      loading = false;
      proxy.$alert(err.data.error.message, '提示');
    });
}
// #endRegion
</script>
<style lang="scss" scoped>
#specCollection {
  height: 100%;
  .bodyContent {
    height: calc(100% - 60px);
    .el-tabs {
      height: 100%;
      background-color: $base-white;
      :deep(.el-tabs__content) {
        height: calc(100% - 39px - 10px);
        padding: 5px;
        .el-tab-pane {
          height: 100%;
          .button-blue,
          .button-red {
            margin: 5px 0 5px 5px;
          }
        }
      }
    }
  }
  .specSignDetailTable {
    height: calc(100vh - 40px - 82px - 5px);
  }
}
</style>
